Four-slot asynchronous communication mechanism with increased throughput

ABSTRACT

System and method for a four-slot asynchronous communication mechanism with increased throughput. The system may include a host system and a client device. The host may comprise a data structure with four (two pairs of) slots and first information indicating a status of read operations from the data structure by the host. The client may read the first information from the host. The client may read second information from a local memory. The second information may indicate a status of write operations to the data structure by the client. The client may determine a slot of the data structure to be written. The slot may be determined based on the first information and the second information and may be the slot which has not been written to more recently of the pair of slots which has not been read from most recently. The client may increment a value of a counter. The value of the counter may be useable to indicate which slot has been written to most recently. The client may write data to the determined slot in the data structure on the host. The data may include the value of the counter. The client may update the second information in the local memory to indicate that the determined slot has been written to most recently.

FIELD OF THE INVENTION

The present invention relates generally to computer systems and moreparticularly to a system and method for transferring data from a clientdevice to a host system.

DESCRIPTION OF THE RELEVANT ART

Direct Memory Access (DMA) is a process by which a DMA subsystem withinor coupled to a computer system (host) can access system memory forreading and/or writing independently of the system's central processor.This leaves the system processor free to perform other tasks. Similarly,if the DMA subsystem is in an embedded system with its own embeddedprocessor, DMA may allow the embedded processor to continue with itsspecific function without diverting unnecessary resources totransferring data to or from the host. This can be particularly usefulin real-time computing situations.

DMA can be initiated on the host side (“pull DMA”), e.g., where the hostsystem initiates the DMA to transfer data from the client to the host,or on the client side (“push DMA”), e.g., where the client initiates theDMA to transfer data from the client to the host. Additionally, in somecases, it may be possible that the DMA subsystem is located either onthe host side (e.g., where the host retrieves data from the client), oron the client side (e.g., where the client sends data to the host)

When the host desires to read the data that is being written by theclient in real time, there is a coherency issue that must be solved.Specifically, if the host were to read the data while the client werewriting the data, the host could read partially old data (e.g., acombination of partially new and partially old data), and thereforepotentially incoherent data. Thus, a mechanism to ensure the coherencyof the data is required.

One approach to this involves locking. In this case the client or thehost may set a ‘lock’ when performing a read or write operation, suchthat the other side cannot access the data until the read or writeoperation is complete. However, locks can cause timing interference,including jitter, latency, and priority inversion.

Some alternatives to locking have been suggested. So-called ‘lock-freealgorithms’ do not use synchronization primitives (i.e. locking),instead often using, for example, Compare-and-Swap instructions in thepolling loop. A further requirement can be made that all operations becompleted in a finite number of steps; such algorithms are known as‘wait-free algorithms’. Wait-free algorithms are also necessarilylock-free.

One such solution involves having multiple data slots at each hostmemory address; in theory, this allows the host to read themost-recently-completely-written data from one slot while the client maywrite to a different slot. Various two- and three-slot algorithms havebeen attempted. However, under certain circumstances, including forexample when the host's reading rate is different from the client'swriting rate, the operations can still overlap for a given slot, so dataincoherence is still possible. A four-slot solution was proposed by H.R. Simpson (Four-slot fully asynchronous communication mechanism,published in the IEE Proceedings, Vol 137, Pt. E, No 1, January 1990,which is hereby incorporated by reference as though fully set forthherein).

This four-slot algorithm successfully provides a guaranteed-coherent,fully asynchronous, wait-free communication mechanism. However, thismethod does require significant communication overhead to ensure fullasynchronicity and data coherence. According to this four-slotalgorithm, the writing device must perform one read from the host andtwo writes to the host for each actual data transfer. This can reducethe overall throughput and increase the latency of the data transfer,especially when performed over a high-latency bus (such as PCI, orPCI-Express). Thus, improvements in the field are desired.

SUMMARY OF THE INVENTION

Various embodiments are presented of a system and method for a four slotasynchronous communication mechanism with improved throughput.

The system may include a host system and a client device. The hostsystem may include a processor and a memory medium. The host memorymedium may include one or more data structures, which may include fourslots for data and may be organized as two pairs of slots. Each slot ofthe data structure may include a counter value, which may be useable toindicate which slot has most recently been written to. The counter valueof each slot may make up the last portion of that slot. The one or moredata structures may further each include a header, which may includeinformation for each data structure (“reading” information) indicatingwhich pair of slots has been read from most recently by the host. The“reading” information may comprise one or more bits.

The client device may include a functional unit and a memory medium. Theclient device may also comprise a DMA device for transferring data fromthe client device (e.g., measurement data acquired by the client device)to the host system. The functional unit may be a programmable hardwareelement, or alternatively, the functional unit may be a processor and amemory medium. In the case where the functional unit is a processor anda memory medium, the memory medium of the functional unit and the memorymedium of the client may be the same memory medium, or different memorymediums, as desired. The client device may include a counter, e.g.,which may be stored on the memory medium. The value of the counter maybe incremented to a new counter value before every write operation thatthe client performs. The client memory medium may include information(“latest” information) indicating, for each data structure on the host,which pair of slots has been written to most recently and which slot ofeach pair of slots has been written to more recently. The “latest”information may comprise one or more bits.

One embodiment includes a method for the client device to transfer datato the host system. According to various embodiments of the method, thefollowing steps may be performed. The client may read the “reading”information from the host memory for a data structure in the hostmemory, which may indicate that the host has read from a first pair ofslots of that data structure most recently. The client may also read the“latest” information from local memory for that data structure. The“latest” information may indicate, for example, that of the second pairof slots, a first slot has been written to more recently. The client mayalso increment the counter. The client may then write data to a slot(e.g. the second slot of the second pair of slots) of the data structurein the host memory. The client may write the data to the particular slotof the data structure based on the “reading” information and the“latest” information. The data may include the current value of thecounter. The value of the counter may be included in the data as thelast portion of the data. The client may finally update the “latest”information in local memory to indicate which slot has been written tomost recently and which pair of slots has been written to most recently.

The method for the client to transfer data to the host may berepeatable. That is, the method may further include performing any orall of the following steps above, e.g., in an iterative fashion,according to various embodiments. The client may read the “reading”information from the host memory for the same data structure in the hostmemory. The “reading” information may be the same as previously, e.g.may indicate that the first pair of slots has still been read from mostrecently, or alternatively, may indicate that the second pair of slotshas been read from most recently by the host. The client may read the“latest” information from local memory for the data structure in thehost memory. The “latest” information may indicate that the slot whichthe client has just written to (e.g. the second slot of the second pair)has been most recently written to; the “latest” information may alsoindicate that a slot of the first pair (e.g., a first slot of the firstpair) has been written to more recently than the other (e.g., a second)slot of the first pair. The client may increment the counter. The clientmay then write (e.g., new) data to a slot of the data structure in thehost memory. The slot written to in this case may be a different slotthan the slot to which the client has just written. If the “reading”information indicated that the first pair had still been read from mostrecently, the slot written to may be, e.g., the first slot of the secondpair of slots. Alternatively, if the “reading” information indicatedthat the second pair of slots had been read from most recently by thehost, the slot written to may be, e.g., the second slot of the secondpair of slots. The client may then update the “latest” information inlocal memory to indicate which slot has been written to most recentlyand which pair of slots has been written to most recently.

Various embodiments of the system may include a memory medium comprisingprogram instructions executable by a processor to perform the foregoingmethod for the client to transfer data to the host in variousembodiments. Further embodiments of the system may include the clientdevice as described above wherein the functional unit may be configuredto perform the foregoing method for the client to transfer data to thehost in various embodiments.

One embodiment includes a method for the host to determine a location ofmost recently transferred data. According to various embodiments of themethod, the following steps may be performed. The host may read thecounter value of each slot in a data structure in the host memory. Thehost may use the counter values of each slot to determine which pair ofslots contains the slot which has been written to most recently. Thehost may update the “reading” information in the host memory for thedata structure in the host memory to indicate that the pair of slotsdetermined to have been written to most recently have been read frommost recently. The host may read the counter value of each slot in thepair of slots determined to contain the slot which has been written tomost recently. The host may use the counter values of each slot in thedetermined pair of slots to determine which slot of the determined pairof slots has been written to most recently. The host may then read datafrom the determined slot of the determined pair of slots.

Various embodiments of the system may include a memory medium comprisingprogram instructions executable by a processor to perform the foregoingmethod for the host to determine the location of most recentlytransferred data in various embodiments. Further embodiments of thesystem may include the host system as described above, wherein the hostmemory medium includes program instructions executable by the hostprocessor to perform the foregoing method.

Various embodiments may include a system including both the host systemand the client device. The host system may be electrically coupled tothe client device to allow communication. The host may be configured asdescribed above. That is, the host may include a processor and a memorymedium where the memory medium stores one or more data structures asdescribed above, “reading” information as described above for each datastructure, and program instructions executable by the host processor toperform the method for the host to determine a location of most recentlytransferred data as described above in various embodiments. Similarly,the client device may be configured as described above. That is, theclient may include a functional unit and memory medium where the memorymedium stores “latest” information as described above, a counter asdescribed above, and where the functional unit is configured to performthe method for the client to transfer data to the host as describedabove in various embodiments.

BRIEF DESCRIPTION OF THE DRAWINGS

A better understanding of the present invention can be obtained when thefollowing Detailed Description of the Embodiments is read in conjunctionwith the following drawings, in which:

FIG. 1 depicts a host system and a client device according to oneembodiment;

FIG. 2 is an exemplary block diagram of a host system and a clientdevice according to one embodiment;

FIG. 3 depicts a representation of a data structure according to oneembodiment;

FIG. 4 depicts a representation of a data structure according to oneembodiment;

FIGS. 5A, 5B, 5C, and 5D depict representations of counter valuesaccording to various embodiments;

FIG. 6 depicts a representation of a plurality of data structures and atable as might be stored in a host memory according to one embodiment;

FIG. 7 depicts a representation of a plurality of data structures and atable as might be stored in a host memory according to one embodiment;

FIG. 8 depicts a representation of a plurality of tables as might bestored in a client memory according to one embodiment;

FIG. 9 is a flowchart diagram illustrating a method for a client totransfer data to a host according to one embodiment;

FIGS. 10A and 105B depict flowchart diagrams illustrating alternateembodiments of a method for a client to transfer data to a host;

FIG. 11 depicts a flowchart diagram illustrating a method for a host todetermine a location of most recently transferred data according to oneembodiment.

While the invention is susceptible to various modifications andalternative forms, specific embodiments thereof are shown by way ofexample in the drawings and are herein described in detail. It should beunderstood, however, that the drawings and detailed description theretoare not intended to limit the invention to the particular formdisclosed, but on the contrary, the intention is to cover allmodifications, equivalents and alternatives falling within the spiritand scope of the present invention as defined by the appended claims.

DETAILED DESCRIPTION OF THE EMBODIMENTS

Terms

The following is a glossary of terms used in the present application:

Computer System—any of various types of computing or processing systems,including a personal computer system (PC), mainframe computer system,workstation, network appliance, Internet appliance, personal digitalassistant (PDA), television system, grid computing system, or otherdevice or combinations of devices. In general, the term “computersystem” can be broadly defined to encompass any device (or combinationof devices) having at least one processor that executes instructionsfrom a memory medium.

Measurement Device—includes instruments, data acquisition (DAQ) devices,smart sensors, and any of various types of devices that are operable toacquire and/or store data. A measurement device may also optionally befurther operable to analyze or process the acquired or stored data.Examples of a measurement device include an instrument, such as atraditional stand-alone “box” instrument, a computer-based instrument(instrument on a card) or external instrument, a data acquisition card,a device external to a computer that operates similarly to a dataacquisition card, a smart sensor, one or more DAQ or measurement cardsor modules in a chassis, an image acquisition device, such as an imageacquisition (or machine vision) card (also called a video capture board)or smart camera, a motion control device, a robot having machine vision,and other similar types of devices. Exemplary “stand-alone” instrumentsinclude oscilloscopes, multimeters, signal analyzers, arbitrary waveformgenerators, spectroscopes, and similar measurement, test, or automationinstruments.

A measurement device may be further operable to perform controlfunctions, e.g., in response to analysis of the acquired or stored data.For example, the measurement device may send a control signal to anexternal system, such as a motion control system or to a sensor, inresponse to particular data. A measurement device may also be operableto perform automation functions, i.e., may receive and analyze data, andissue automation control signals in response.

Memory Medium—Any of various types of memory devices or storage devices.The term “memory medium” is intended to include an installation medium,e.g., a CD-ROM, floppy disks 104, or tape device; a computer systemmemory or random access memory such as DRAM, DDR RAM, SRAM, EDO RAM,Rambus RAM, etc.; or a non-volatile memory such as a magnetic media,e.g., a hard drive, or optical storage. The memory medium may compriseother types of memory as well, or combinations thereof. In addition, thememory medium may be located in a first computer in which the programsare executed, and/or may be located in a second different computer whichconnects to the first computer over a network, such as the Internet. Inthe latter instance, the second computer may provide programinstructions to the first computer for execution. The term “memorymedium” may include two or more memory mediums which may reside indifferent locations, e.g., in different computers that are connectedover a network.

Programmable Hardware Element—includes various hardware devicescomprising multiple programmable function blocks connected via aprogrammable interconnect. Examples include FPGAs (Field ProgrammableGate Arrays), PLDs (Programmable Logic Devices), FPOAs (FieldProgrammable Object Arrays), and CPLDs (Complex PLDs). The programmablefunction blocks may range from fine grained (combinatorial logic or lookup tables) to coarse grained (arithmetic logic units or processorcores). A programmable hardware element may also be referred to as“reconfigurable logic”.

Functional Unit—may include a processor and memory or a programmablehardware element. The term “functional unit” may include one or moreprocessors and memories and/or one or more programmable hardwareelements. As used herein, the term “processor” is intended to includeany of types of processors, CPUs, microcontrollers, or other devicescapable of executing software instructions.

FIG. 1—Exemplary Host System and Client Device

FIG. 1 illustrates a host system 100 (or simply “host”) that is coupledto a client device 150 according to one embodiment. As shown in FIG. 1,the host system may be a computer system 100. The computer system 100may include a display device operable to display a program (e.g., agraphical user interface to the program) as the program is createdand/or executed as well as various input devices. The graphical userinterface may comprise any type of graphical user interface, e.g.,depending on the computing platform.

The computer system 100 may include at least one memory medium on whichone or more computer programs or software components according to oneembodiment of the present invention may be stored. The memory medium mayalso store operating system software, as well as other software foroperation of the computer system. The computer system may additionallyhave one or more hardware components. In some embodiments, the computersystem may include one or more DMA subsystems, e.g., for transferringdata from a client device to the computer system. However, in otherembodiments, the computer system may not include a DMA subsystem

The client device 150 may be a measurement device. The client device 150may include a chassis, for example a PCI or a PXI chassis. The chassismay include one or more slots which may be configured to receive acorresponding one or more pluggable cards. For example, the cards may beany of various types, e.g., cards for controlling or interacting withinstruments or devices, I/O cards for receiving and/or manipulatingdata, computer cards (e.g., including a processor and memory medium orconfigurable hardware unit) which may be configured to performcomputational functions, and/or other types of cards, as desired. One ormore of the plurality of cards may include a configurable orprogrammable hardware element which may be configured to perform one ormore functions.

The chassis may include a backplane. In some embodiments, the backplanemay include a programmable hardware unit, such as a field programmablegate array (FPGA), which may be usable for configuring the chassis toperform one or more functions (e.g., using a subset or all of aplurality of cards inserted into the chassis).

The backplane may provide one or more busses, e.g. PCI or PXI busses,for communicating with (and between) the plurality of cards. Thecomputer system 100 may be usable to configure and/or control thechassis. For example, the computer system 100 may be used to configureone or more of the cards inserted in the chassis. In furtherembodiments, as indicated above, the backplane of the chassis mayinclude a configurable hardware unit (e.g., an FPGA), and the computersystem 100 may be usable to configure the programmable hardware unit(e.g., with a graphical program, such as one created using LabVIEW®provided by National Instruments Corporation, as is described in U.S.Pat. No. 6,219,628 B1, whose title was “System and Method forConfiguring an Instrument to Perform Measurement Functions UtilizingConversion of Graphical Programs into Hardware Implementations”, andwhose authors were Jeffrey L. Kodosky, Hugo Andrade, Brian K. Odom, andCary P. Butler, and which is hereby incorporated by reference as thoughfully set forth herein). Thus, the computer system 100 may be usable tocontrol or configure the chassis to perform one or more functions (e.g.,industrial or measurement functions).

Embodiments of the present invention may be involved with performingtest and/or measurement functions; controlling and/or modelinginstrumentation or industrial automation hardware; modeling andsimulation functions, e.g., modeling or simulating a device or productbeing developed or tested, etc.

In some embodiments, the client device may include a DMA subsystem,e.g., for transferring data from the client to the host. However, inother embodiments, e.g., if the host includes a DMA subsystem fortransferring data from the client to the host, the client device may notinclude a DMA subsystem. In some embodiments, both the client and thehost may include DMA subsystems.

It is worth noting that while FIG. 1 depicts the client device 150 asphysically distinct and separated from the computer system 100, variousembodiments are also possible where the client device 150 is located inthe same chassis or case as the host 100. Generally speaking a “clientdevice” (or simply “client”) 150 may be any hardware subsystem which maybe coupled to a computer system and capable of communicating with thehost system 100 and should not be limited only to the client devicesdepicted or described above. Further worth noting is that while FIG. 1shows one (1) client device coupled to one (1) host system, otherembodiments with different numbers of either clients devices, hostsystems, or both, are also envisioned.

Other examples of a client-host system might include real-time computingsituations and/or embedded systems. Some such embodiments could include,for example, a vehicle with a host 100 (e.g. a microcontroller)communicating with one or more client devices 150 (e.g. speedometer,tachometer, etc) over a bus such as controller-area network (CAN) orFlexRay.

Many of the embodiments described above may include transferring data(e.g. acquired in performing test and/or measurement functions) from theclient to the host, for example may include transferring the latest dataacquired to a data structure on the host according to one or moreembodiments of the present invention.

It should also be noted that in various embodiments, the four slot datatransfer mechanism described herein may be used in other contexts inaddition to or instead of a data transfer between a client and a host.For example, in one embodiment, the four slot data transfer mechanismdescribed herein may be used to transfer data locally within a hostsystem, or within another device, among other possibilities. One suchembodiment might include a data transfer (e.g., a DMA) from a clientdevice to a host buffer, from which a local (host) process might, e.g.,parse the data and use the four slot data transfer mechanism to move itto the host tables from which the host (e.g., a host processor) mightthen read the data. Other embodiments might not require a client-hostdata transfer at all, e.g., may only involve local data transfer(s).

FIG. 2—Exemplary Block Diagram of a Host System and a Client Device

FIG. 2 depicts a block diagram of a host system 100 coupled to a clientdevice 150 according to one embodiment. As shown, the host 100 mayinclude at least a processor 210 and a memory medium 220. The host mayalso include additional components, for example the host may be acomputer system 100 as depicted in FIG. 1 and described above. The host100 may additionally be coupled to one or more other devices in someembodiments, e.g. other client devices and/or other host systems.

The memory medium 220 of the host 100 may include one or more datastructures 222 according to various embodiments. A data structure 222 asused herein may refer to a specific structure in which data may bestored, to which data may be written, and/or from which data may beread. For example, the data structure 222 may have four “slots”, whichmay be divided into two pairs of slots. Thus each slot may bedistinguishable, e.g., with a two-bit label designating the pair ofslots and the slot within the pair of slots. Thus, the host 100 or theclient 150 may be able to specify a specific slot within a given datastructure 222 to write to or to read from, and may be able to maintaininformation relating to the reading or writing status of each slot of agiven data structure 222. It should be noted that in some embodimentsthe four slots may not simultaneously contain useful data; rather, theremay be four slots in each data structure 222 primarily for the purposeof ensuring that the communication mechanism is fully deterministic forasynchronous communication and that the data transferred is always fullycoherent. Thus the host system 100 may only need the most recent data(e.g. in the most recently written data slot) in a given data structure222 at any one time.

A data structure 222 may further include one or more “headers”, whichmay indicate some specific information about the slots of the given datastructure. For example, a data structure 222 might include “reading”information, indicating which pair of slots has been most recently readfrom. The memory medium on the host may also or alternatively includeone or more tables 224 of information. For example, there may be aplurality of similar data structures 222 in the host's memory medium220, and rather than storing the “reading” information for each datastructure 222 as a header of that data structure, the “reading”information may all be stored in a single table 224, such that the“reading” information for a given data structure may be separate frombut still associated with the given data structure 222. More detaileddescription of the information that may be stored on the host memorymedium is provided below in the context of the various embodimentsinvolved.

The client device 150 may include at least a functional unit 260 and amemory medium 270. As defined above, a functional unit 260 may include aprocessor and a memory medium, or may include a programmable hardwareelement, or may include a combination of such elements, which may beconfigurable to perform one or more embodiments of the presentinvention. In some embodiments, e.g. when the functional unit 260 is aprocessor and a memory medium, the memory medium of the functional unitand the memory medium 270 shown in FIG. 2 may be the same memory medium,e.g. there may only be one memory medium 270 on the client side. Inaddition, there may be one or more data acquisition (DAQ) cards 280 orother means of acquiring data on or coupled to the client device 150.The client device 150 may additionally be coupled to one or more otherdevices in some embodiments. Alternatively, the client device may becoupled only to the host system 100 and may not be configured to acquiredata independently from the host 100.

The memory medium 270 on the client device 150 may include informationcorresponding to one or more data structures 222 on the host 100. Invarious embodiments, for example, the client memory medium 270 mayinclude information for each data structure 222 on the host memorymedium 220 indicating which pair of slots has been written to mostrecently, which slot of each pair has been written to most recently,and/or which pair of slots has been read from most recently. In someembodiments, the client memory medium 270 may include informationindicating the potential validity or invalidity of some or all of theinformation corresponding to the one or more data structures on thehost. More detailed description of the information that may be stored onthe client memory medium is provided below in the context of the variousembodiments involved.

The client 150 may be coupled to the host 100 such that data may betransferred in either direction, e.g. from the host 100 to the client150 or from the client 150 to the host 100.

FIG. 3—Data Structure on a Host System According to One Embodiment

FIG. 3 depicts a data structure 222A as might exist in the host memory220 according to one embodiment. The data structure 222A picturedincludes four slots 310, 320, 330, 340, each of which may be designatedby a two bit address: the first pair, first slot may be (0,0) 310; thefirst pair, second slot may be (0,1) 320; the second pair, first slotmay be (1,0) 330; and the second pair, second slot may be (1,1) 340. Thedata structure 222A pictured also includes a header 350A.

The header 350A in this embodiment includes “reading” information 360.“Reading” information 360 as used herein refers to information thatindicates, for a given data structure, which pair of slots has been readfrom most recently, e.g., by the host system 100. The “reading”information may be stored as a single bit, e.g. a ‘0’ for the first pairof slots or a ‘1’ for the second pair of slots. It may also be possibleto store the “reading” information 360 as more than one bit.

The header 350A in this embodiment also includes “latest” information370. “Latest” information 370 as used herein refers to information thatindicates, for a given data structure, which pair of slots has beenwritten to most recently, which slot of the first pair of slots has beenwritten to more recently, and which slot of the second pair of slots hasbeen written to more recently, e.g., by the client 150. The “latest”information 370 may be stored as three bits, depicted in FIG. 3 as ‘S’,‘s’, and ‘L’. For example, ‘S’ may indicate the slot of the first pairof slots that has been written to more recently; in this case if the ‘S’bit read ‘0’, it would indicate that the first slot of the first pair ofslots 310 has been written to more recently. The ‘s’ bit may similarlyindicate which slot of the second pair of slots has been written to morerecently. The ‘L’ bit may indicate which pair of slots has been writtento most recently in a similar manner. Thus in this embodiment, if the‘L’ bit reads ‘1’ and the ‘s’ bit reads ‘0’, the “latest” information370 may indicate that the first slot of the second pair of slots 330 hasbeen written to most recently. Other ways of storing, labeling, andusing the “latest” information 370 are also envisioned, for example the“latest” information 370 may include a different number of bits, and/orthe meanings of bits reading ‘1’ and ‘0’ may be reversed, among otherpossibilities.

Various of the embodiments described below may also refer to “reading”information and “latest” information, such as are described with respectto this data structure. In general, although the way the information isstored may vary in the different embodiments, the meanings of “reading”information and “latest” information may be consistent throughout thissection.

FIG. 4—Data Structure on a Host System According to Another Embodiment

FIG. 4 depicts a data structure 222B according to another embodiment. Inthe data structure 222B of FIG. 4, there is a header 350B including“reading” information 360 as in the data structure 222A of FIG. 3.Similarly, there are four data slots 410, 420, 430, 440, which can bedesignated by two bit addresses in a similar manner to the data slots310, 320, 330, 340 of FIG. 3. However, there is no “latest” information360 in the header 350B in this embodiment. Instead, there is a portionof each data slot 415, 425, 435, 445 designated for a counter value(which could also be considered a timestamp). The portion of the dataslot designated for a counter value 415, 425, 435, 445 may be the finalportion, e.g. the final 32 bits, or the final 64 bits.

The counter values may be useable to indicate the “latest” information370. In other words, by reading and comparing the counter values foreach data slot, the host 100 may be able to determine which pair ofslots has been written to most recently, and which slot of each pair ofslots has been written to more recently. For example, a higher countervalue may indicate a more recent write action. Thus in this example, theslot with the highest counter value would be the most recently writtenslot, and the pair of slots containing this slot would be the pair mostrecently written to. The slot with the higher counter value of the otherpair of slots would be the slot more recently written to for that pairof slots. Other counting systems may also be possible, for example lowercounter values may indicate more recent write actions; other embodimentsare also envisioned.

It should be noted that in some embodiments the counter value may haveto be located in the final portion of each data slot. For example, ifthe counter value is not located the final portion of the data slot,e.g., if the counter value is in another portion of the data slot, suchas the first portion or somewhere in the middle of the data slot, thiscould result in data coherency problems. That is to say, if a data slotwere to contain data after the counter value, the host could read anewly written counter value in a data slot, determine that the slotcontaining the newly written counter value is the most recently writtento slot, and read the data in that data slot, all before that data slot(e.g., the portion of the data slot after the counter value) had beenfully written. This could therefore result in the host readingincoherent data; thus, data coherency requirements may necessitate thatthe counter value be the last portion written to in any write operationincluding a counter value.

FIGS. 5A-5D—Counter Values According to Various Embodiments

According to some embodiments, the counter value may be the last 64 bitsof each data slot. These 64 bits may be written as two 32 bit words.Thus in some embodiments it may be important to ensure that even if thehost 100 reads the counter values to determine the location of the mostrecently written data while the client 150 is writing a new countervalue to the data slot which it has just written, the host will stillread data which is coherent and which is the most recently fully writtendata. If the counter value is written in little-endian format, this isassured. FIGS. 5A-5D illustrate the various cases. In each figure, the“Last Frame” 702 refers to a counter value previous to the write. “NewFrame (intermediate)” 704 refers to a counter value after the secondword of the counter has been updated and before the first word of thecounter has been updated. “New Frame (final)” 706 refers to a newcounter value in its entirety such as it would read after the client isfinished writing to that slot.

FIG. 5A depicts the case where the first word 708 of the counter is thesame in both the previous counter value 702 and the new counter value706. In this case, the counter would correctly indicate that thewritten-to slot was the most recently written slot if read at theintermediate stage 704.

FIG. 5B depicts the case where the first word 708 of the counter ishigher in the new counter value 706 than in the old counter value 702,and the second word 710 of the counter is lower in the new counter value706 than in the old counter value 702. Thus the intermediate stage 704reads as an older value. If the host 100 reads the counter value at thispoint it will consider the next-most-recently written slot as the mostrecently written slot. In fact this is correct since the write is notconsidered complete until the entire slot (including the counter value)is transferred, so logically, the host would not read old data, butwould read the most recent fully complete data.

FIG. 5C depicts the case where both the first word 708 of the counterand the second word 710 of the counter are higher in the new countervalue 706 than in the old counter value 702. Thus the intermediate stage704 reads as a newer value, although not the fully correct new value. Ifthe host 100 reads the counter value at this point it may consider thisthe most recently written slot, in which case it will read the new data,which is fully coherent. Alternatively the host may consider thenext-most-recently written slot as the most recently written slot (if,for example, the next-most-recently-written slot has a counter value inbetween the intermediate value of this slot and the new counter value ofthis slot). In this case, as in 5B, the host 100 would read the mostrecent fully complete data, which is also coherent.

FIG. 5D depicts the case where the first word 708 of the counter ishigher in the new counter value 706 than in the old counter value 702,and the second word 710 of the counter is the same in the new countervalue 706 as in the old counter value 702. In this case the intermediatestage 704 will read as the old counter value 702. If the host reads thecounter value at this point it will consider the next-most-recentlywritten slot as the most recently written slot, and again as in 5B, willread the most recent fully complete data, which is fully coherent.

It should be noted that in some embodiments, for example in which datais written by a client device 150 frequently, and the counter isrelatively small, e.g. 32 bits, an overflow condition could periodicallyoccur, leading to older data being read. However, a 64 bit counter, forexample, is unlikely to have this problem. A 64 bit count could beincremented 18,446,744,073,709,551,615 times before overflowing. Even ifa client device 150 writes every 1 μs, this would allow at least 584,000years before the overflow condition is reached.

FIG. 6—A Plurality of Data Structures and a Table stored in a HostMemory

FIG. 6 depicts a plurality of data structures 222C which may be storedin the host memory 220 along with a table 224 which may be stored in thehost memory 220 according to one embodiment. There may be any number ofdata structures in the host memory, e.g., there may be N datastructures, where N may be 10, 100, 1000, or any number. The datastructures 222C may be similar, though in some embodiments notidentical, to the data structure 222A depicted in FIG. 3; they each mayinclude four data slots 310, 320, 330, 340 which may be designated bytwo bit addresses, and they each may include a header 350C with “latest”information 370.

The data structures 222C may not each include “reading” information 360in the header 350C. Instead, there may be a separate host reading table224 which stores the “reading” information 360 for all of the datastructures 222C. The “reading” information 360 for each data structure222C may be stored as a single bit and indicate which pair of slots hasbeen read from most recently just as described with relation to FIG. 3.The “reading” information 360 for all of the data structures 222C maysimply be stored as a single separate table 224 instead of each datastructure's “reading” information 360 being included individually in theheader 350C of each data structure 222C.

FIG. 7—A Plurality of Data Structures and a Table Stored in a HostMemory

FIG. 7 depicts a plurality of data structures 222D which may be storedin the host memory 220 along with a table 224 which may be stored in thehost memory 220 according to another embodiment. There may be any numberof data structures in the host memory, e.g., there may be N datastructures, where N may be 10, 100, 1000, or any number. The datastructures may each include four data slots 410, 420, 430, 440 which maybe designated by two bit addresses, as described above with relation tothe data structures of FIGS. 3, 4, and 6. As with the data structure222B depicted in FIG. 4, each data slot may include a portion designatedfor a counter value 415, 425, 435, 445. The designated portion 415, 425,435, 445 may be the final portion of each slot, e.g. the final 64 bitsof each slot. The counter values for each data structure may function inall respects as those described above with respect to FIG. 4, e.g. theymay be useable to indicate the “latest” information 370. The datastructures 222D may not include any headers.

The table may be a host reading table 224. The host reading table 224may function in a similar manner to the host reading table 224 depictedin FIG. 6 and described above, e.g. may include the “reading”information 360 for each data structure 222D included in the host memory220 all in a single separate table 224.

FIG. 8—A Plurality of Tables Stored in a Client Memory

FIG. 8 depicts a plurality of tables 274 as might be stored in theclient memory 270 according to one embodiment. One or all of thesetables may be stored in the client memory 270 according to variousembodiments.

There may be a reading table 802. The reading table 802 may correspondto a host reading table 224 in the host memory 220, for example the hostreading table 224 of FIG. 6 or FIG. 7. The reading table 802 in clientmemory 270 may be a copy of the host reading table 224 in the hostmemory 220, e.g. the information in the reading table 802 may beobtained or updated only by retrieving that information from the host.The reading table 802 may contain “reading” information 360 for each ofa plurality of data structures in the host memory 220.

There may be a reading information status table 804. The readinginformation status table 804 may include “reading information status”information 860 for each data structure 222 of the plurality of datastructures 222 in the host memory 220. “Reading information status”information 860 may indicate, for a given data structure 222 in the hostmemory 220, whether that data structure 222 has been written to sincethe reading table 802 was most recently updated. In other words, the“reading information status” information 860 for a given data structure222 provides an indication that the “reading” information 360 in thereading table 802 for that data structure 222 is valid (e.g., if thedata structure 222 has not been written to since the reading table 802was most recently updated), or alternatively, provides an indicationthat the “reading” information 360 in the reading table 802 may not bevalid (e.g., if the data structure 222 has been written to since thereading table 802 was most recently updated). Since the “reading”information 360 originates from the host 100, including this “readinginformation status” information on the client 150 may allow the client150 to update the “reading” information 360 (e.g., perform a readoperation) from the host 100 less frequently than without the “readinginformation status” information 860.

There may be a writing table 806. The writing table 806 may include“latest” information 370 for each data structure 222 in the host memory220. The “latest” information 370 for each data structure 222 mayindicate which pair of slots has been written to most recently, andwhich slot of each pair of slots has been written to more recently. The“latest” information 370 for each data structure 222 may include threebits, or another number of bits.

FIG. 9—Flowchart Diagram of a Method for a Client Device to TransferData to a Host

FIG. 9 is a flowchart diagram of a method for a client device totransfer data to a host according to one embodiment. The method of FIG.9 is intended to provide an increase in throughput of an asynchronousdata transfer in a four slot communication mechanism over the prior art.The prior art requires three DMA operations for each data transfer (oneread and two writes). In the method of FIG. 9, the two write steps areessentially combined. That is to say, instead of a separate write to aheader in a data structure to provide the host with “latest”information, the method adds a counter value to the actual data writtento each data slot. The counter values are useable by the host to obtainequivalent “latest” information without requiring an additional DMAwrite operation.

The method depicted in FIG. 9 and described below may be performed inconjunction with one or more of the systems described above and depictedin FIGS. 1 and 2. The steps of the method may be as follows.

In 902, the client device 150 may read “reading” information 360 from adata structure 222 in the host memory 220. The data structure 222 in thehost memory 220 may preferably be the data structure 222B depicted inFIG. 4 and described above. Thus the “reading” information 360 mayindicate which pair of slots has been read from by the host mostrecently.

In 904, the client device 150 may read “latest” information 370 from alocal memory 270. The local memory 270 may include a writing table 806such as the one depicted in FIG. 8. Thus the “latest” information 370may indicate which slot of the most recently read from pair of slots hasbeen written to most recently. Other ways of storing “latest”information in addition to or instead of a writing table are alsoenvisioned.

In 906, the client device 150 may increment a counter locally. Thecounter may be stored in a local memory 270 or may be comprised in aprogrammable hardware element; other ways of storing the counter mayalso be possible. In some embodiments, the client device 150 may includeone counter for all of the (one or more) data structures 222B in thehost memory 220. In this case the client 150 may increment the counterbefore every write, e.g. before the client 150 writes to any datastructure 222B in the host memory 220. Alternatively, there may be acounter in the client memory 270 for each data structure 222B in thehost memory 220, and the client 150 may increment the counter onlybefore writes to the particular data structure 222B associated with thatcounter. In general, the counter may be used to mark the relative orderin which the slots of a data structure have been written. For example,the first slot written may have a counter value of 1. The second slotmay have a counter value of 2. The third slot written may have a countervalue of 3. The counter values may continue to increment sequentiallywith each write, thus in one example, the counter values of the slotsmight read 17 and 21 for the first pair, and 20 and 22 for the secondpair. In this example, the second slot of the first pair has beenwritten to more recently of the first pair, the second slot of thesecond pair has been written to more recently of the second pair, andthe second pair has been written to most recently. Thus, the countervalues may be usable to indicate which pair has been written to mostrecently and which slot of each pair has been written to more recently.

In 908, the client device 150 may write data to a slot in the datastructure 222B in the host memory 220 based on the “reading” 360 and“latest” information 370. The slot may be the slot which has not beenwritten to more recently of the pair of slots that has not been readfrom most recently. In other words, the client 150 may first determinewhich pair of slots the host 100 may be reading from. In order to avoidoverwriting data while it is being read (which could lead to the host100 reading incoherent data), the client 150 may choose to avoid thepair of slots which the host 100 has read from most recently. Then, theclient 150 may determine which slot of the remaining pair of slots hasbeen written to most recently. In case the host 100 finishes readingfrom the other pair of slots and reads the more-recently-written slot ofthis pair of slots before the client 150 finishes writing, the client150 may choose to avoid the more-recently-written slot of this pair ofslots. Thus, the client 150 may write to the slot which contains theoldest data in the pair of slots not currently being read from by thehost 100. The data may include measurement data, for example, datacollected by the client device, e.g., using a DAQ card or other means ofdata acquisition. The data may be another kind of data instead ofmeasurement data, or may include measurement data and other data. Thedata written to the slot may include the value of the counter, forexample, the counter size may be set as 64 bits, and the last 64 bits ofthe data written may be the value of the counter.

In 910, the client device 150 may update the “latest” information 370 inthe local memory 270. The client 150 may update the “latest” information370 to indicate that the slot which has just been written to is themost-recently-written-to slot, and the pair including that slot is thepair of slots which has been written to most recently. This may benecessary so that the client 150 has the correct information the nexttime the client wants to transfer data.

FIGS. 10A-10B—Flowchart Diagrams of Alternate Embodiments of a Methodfor a Client Device to Transfer Data to a Host System

FIGS. 10A and 10B depict flowchart diagrams illustrating alternateembodiments of a method for a client device to transfer data to a hostsystem. The methods of 10A and 10B are primarily intended to decreasethe overall latency of an asynchronous data transfer utilizing a fourslot communication mechanism. The method depicted in FIG. 10Billustrates embodiments of a system where a host has a plurality of datastructures in a host memory in which it is possible to receive data froma client device. The client may hold similar data (e.g., “reading”information) for all of the data structures in the host memory in one ormore tables in the client's own memory. As long as the data in theclient's memory is accurate (e.g., identical to the “reading”information set by the host and stored in the host memory), the clientcan use this information to determine a write location without requiringa DMA read operation to get this information from the host. The methodthus includes “reading information status” information in the clientmemory to ensure the accuracy of the local “reading” information. In theideal circumstances, this may allow the client to read the “reading”information for the entire plurality of data structures in the hostmemory once, by performing a single DMA read, then write to each of theplurality of data structures in turn without requiring another DMA readuntil all of the plurality of data structures have been written to. Saidanother way, if there were 300 data structures in the host memory, underideal conditions this method would make one DMA read operation over thecourse of 300 data transfers (one transfer to each of 300 datastructures), as compared to the prior art solution which would require300 DMA read operations for 300 data transfers (i.e. a DMA read forevery data transfer).

The method depicted in 10A illustrates essentially the same method as10B, but for a host memory containing only a single data structure. Inthis system the method would still require a DMA read for every datatransfer and thus its usefulness may be reduced; however, such a systemmay be unlikely to occur in reality, but for explanation, it has beenincluded.

The method depicted in FIGS. 10A and 10B and described below may beperformed in conjunction with one or more of the systems described aboveand depicted in FIGS. 1 and 2. The steps of the methods may be asfollows.

In 1000, a client 150 may read “reading information status” information860 from a local memory 270 for a data structure 222 in a host memory220. The data structure 222 may preferably be either the data structure222C of FIG. 6 or the data structure 222D of FIG. 7 in variousembodiments. The “reading information status” information 860 mayindicate that the “reading” information 360 stored in a reading table802 in local memory 270 either is valid or may not be valid for the datastructure 222.

As shown in step 1002, if the “reading information status” information860 indicates that the “reading” information 360 is valid, the methodmay continue to step 1010, potentially skipping steps 1004A, 1006A, and1008A or 1004B, 1006B, and 1008B and thereby eliminating a DMA readoperation. If the “reading information status” information 860 indicatesthat the “reading” information 360 may not be valid, the method maycontinue to step 1004A or 1004B.

In 1004A the client 150 may read “reading” information 360 from the hostmemory 220 for the data structure 222 in the host memory 220. The“reading” information 360 in the host memory 220 may be stored in a hostreading table 224. Alternatively, in 1004B, the client 150 may read“reading” information 360 from the host memory 220 for a plurality ofdata structures 222 in the host memory 220. For example, the client 150may read the entire reading table 224 from the host memory 220.

In 1006A the client 150 may update the “reading” information 360 in thelocal memory 270 for the data structure 222. For example the client 150may update a “reading” bit for the data structure 222 in a reading table802 in local memory 270 to match the corresponding “reading” bit in thehost reading table 224 in host memory 220. Alternatively, in 1006B, theclient 150 may update the “reading” information 360 in local memory 270for a plurality of data structures 222 in host memory 220. For example,the client 150 may update an entire reading table 802 in local memory270 to match the entire host reading table 224 in host memory 220.

In 1008A the client 150 may update the “reading information status”information 860 in local memory 270 for the data structure 222. Forexample the client 150 may update a “reading information status” bit forthe data structure 222 to indicate that the “reading” information 360 inlocal memory 270 for that data structure 222 is valid, e.g. that thedata structure 222 has not been written to since the “reading”information 360 in local memory 270 has been most recently updated.Alternatively, in 1008B, the client 150 may update the “readinginformation status” information 860 for a plurality of data structures222 in the host memory 220, for example, the client 150 may update anentire reading information status table 804 in local memory 270 toindicate that the “reading” information 360 for each of the plurality ofdata structures 222 is valid.

After step 1008A or 1008B, the “reading information status” information860 may indicate that the “reading” information 360 for that datastructure 222 is valid. The condition for step 1010 may thus be met andthe method may therefore continue with step 1010.

In step 1010, the client 150 may read “reading” information 360 in localmemory 270 for the data structure 222 in the host memory 220. The“reading” information 360 may be stored in a reading table 802 in thelocal memory 270, e.g. along with “reading” information 360 for aplurality of other data structures 222 in the host memory 220. The“reading” information 360 for that data structure may indicate whichpair of slots has been read from most recently.

In step 1012, the client 150 may read “latest” information 370 in localmemory 270 for the data structure 222 in the host memory 220. The“latest” information 370 may be stored in a writing table 806 in thelocal memory 270, e.g. along with “latest” information 370 for aplurality of other data structures 222 in the host memory 220. The“latest” information 370 for that data structure may indicate which slotof each pair of slots has been written to most recently.

In 1014, the client 150 may increment a counter locally. The counter maybe similar or identical to any of the above described counters. Thecounter may be incremented to a latest value. Alternatively, in someembodiments there may not be a counter on the client 150, and this stepmay be skipped.

In 1016, the client 150 may write data to a slot in the data structure222 in the host memory 220 based on the “reading” information 360 andthe “latest” information 370. The slot may be the slot which has notbeen written to most recently of the pair of slots that has not beenread from most recently. The data may include measurement data, forexample, data collected by the client device 150, e.g., using a DAQ cardor other means of data acquisition. The data may be another kind of datainstead of measurement data, or may include measurement data and otherdata. The data may include the latest value of the counter, thuseffectively including a form of “latest” information 370 in the datastructure for the host to use. The value of the counter may be writtenas the last portion of the data, for example, the size of the countervalue may be set as 64 bits, and the last 64 bits of the data may be thevalue of the counter.

In 1018, the client 150 may update the “reading information status”information 860 in local memory 270. This may include updating a“reading information status” bit in a reading information status table804 to indicate that the data structure 222 has been written to sincethe “reading” information 360 in the local memory 270 (e.g. in a readingtable 802) has been most recently updated. In this way, the client 150may ensure that the client 150 will update its “reading” information 360the next time it wants to transfer data to that data structure, if ithasn't done so in the course of transferring data to another datastructure before then.

In 1020, the client 150 may update the “latest” information 370 in localmemory 270. This may include updating the “latest” bits in a writingtable 806 to reflect the location of the write operation just performed.

In some embodiments, e.g., where there is no counter and the datawritten does not include a latest counter value, there may be anadditional DMA write operation required, e.g. to write the “latest”information 370 to a header of the data structure, for example if thedata structure 222 is the data structure 222C of FIG. 6.

Various embodiments of data structures, tables, and methods for a clientto transfer data to a host have been presented. It should be noted thatan optimal embodiment may include a transfer according to the method ofFIG. 10B into a host memory as shown in FIG. 7, supported by the tablesshown in FIG. 8 in the client memory. This may combine the throughputincrease provided by utilizing a counter (thereby eliminating a DMAwrite operation) with the latency decrease provided by storing a copy ofthe “reading” information for a plurality of data structures in theclient memory (thereby eliminating a DMA read operation under normalconditions). In this case, where the host has a plurality of datastructures, a best case scenario would allow most data transfers fromthe client to require only a single DMA write. That is, the initial DMAread and the final DMA write required by the prior art may beunnecessary in this system for most data transfers. As a large portionof the time associated with asynchronous data transfer is often overheadassociated with each DMA operation, cutting out two of the three DMAsteps, although it may in some embodiments introduce additional overheadfor the remaining DMA step, may result in a significant increase inthroughput and decrease in latency over the prior art.

FIG. 11—Method for a Host to Determine a Location of Most RecentlyTransferred Data

FIG. 11 depicts a flowchart diagram illustrating a method for a host todetermine a location of most recently transferred data according tovarious embodiments. Embodiments of the method may be used inassociation with one or more of the methods described above for a clientto transfer data to a host; for example the most recently transferreddata whose location the host determines in this method may have beentransferred to the host according to one of the methods for a clientdevice to transfer data to a host system.

The method depicted in FIG. 11 and described below may be performed inconjunction with one or more of the systems described above and depictedin FIGS. 1 and 2. The steps of the methods may be as follows.

In 1102 a host 100 may read “latest” information of a data structure 222in a local memory 220. The data structure 222 may be a four slot datastructure 222 and may or may not include a header, which may include“reading” and/or “latest” information as variously previously describedaccording to different embodiments. In one embodiment the “latest”information for the data structure may be included as a counter valuefor each slot of that data structure. The counter value for each slotmay provide an indication of how recently the data was written, forexample, a slot with a highest counter value may have been written tomost recently. Alternatively the data structure 222 may include a headerincluding “latest” information 370 and the host 100 may read the“latest” information 370 from the header In this case the data structure222 may not include counter values for each slot of the data structure.

In 1104 the host 100 may determine the pair of slots containing the mostrecently written slot of in the data structure 222. The host 100 maymake this determination based on having read the counter value for eachslot; for example, the host 100 may determine that the pair of slotscontaining the slot with the highest counter value may have been writtento most recently. Alternatively, if the data structure includes a headerincluding “latest” information 370 and the host 100 reads the “latest”information 370 instead of the counter values for each slot, the host100 may make the determination of the pair of slots based on the“latest” information 370 read from the header of the data structure 222.

In 1106 the host 100 may update “reading” information 360 in the hostmemory 220. The “reading” information 360 may be in a header in the datastructure 222 as in the data structure 222B of FIG. 4. Alternatively the“reading” information 360 may be in a table such as the host readingtable 224 of FIG. 7. The host 100 may update the “reading” information360 to indicate that it is reading from the pair determined to containthe most recently written data. The host may need to update the“reading” information 360 in order to ensure full coherence, e.g., toensure that the client device 150 doesn't write over the slot from whichthe host 100 will read while the host is reading from that slot.

In 1108 the host 100 may read the “latest” information for thedetermined pair of slots. This may include reading the counter value foreach slot in the determined pair of slots. Although the host 100 mayhave already read the counter values for each slot, it may be necessaryto read the counter values of the determined pair again after updatingthe “reading” information 360 to ensure the data coherency of the datato be read and to avoid any potential problems such as race conditionswith the client 150 that might otherwise develop if the host 100 simplyused the previously read counter values. Alternatively, as noted above,the data structure 222 may include a header including “latest”information 270 and the host 100 may read the “latest” information 270from the header instead of reading the counter values for each slot.Again, in this embodiment, there may not be counter values for each slotof the data structure.

In 1110 the host 100 may determine the slot containing the most recentlywritten data. The host 100 may make this determination based on thecounter values read after updating the “reading” information 360, e.g.the counter values read in step 1108. As noted, this may help ensuredata coherency and avoid race conditions with the client 150 as itperforms any write operations. The determined slot may be the slot whichhas been written to most recently, as indicated by the counter value forthat slot. Again, alternatively, if the data structure 222 includes aheader including “latest” information 370 and the host 100 reads the“latest” information 370 instead of the counter values for each slot,the host 100 may make the determination of the slot based on the“latest” information 370 read from the header of the data structure 222.

In 1112 the host 100 may read data from the determined slot. The dataitself may be measurement data, instrument data, or generally any kindof data where only the most recent set of data need be available to thehost system 100. The data may include data in addition to the countervalue, that is, the counter value may not be the only data read by thehost.

Although the embodiments above have been described in considerabledetail, numerous variations and modifications will become apparent tothose skilled in the art once the above disclosure is fully appreciated.It is intended that the following claims be interpreted to embrace allsuch variations and modifications.

We claim:
 1. A method of transferring data from a client device to ahost system, comprising: the client reading a first one or more bitsfrom a data structure on the host, wherein the data structure comprisesa first pair of slots, a second pair of slots and the first one or morebits, and wherein the first one or more bits indicate that the firstpair of slots has been read from most recently by the host; the clientreading a second one or more bits from a local memory, wherein thesecond one or more bits indicate that a first slot of the second pair ofslots has been written to more recently; the client incrementing a valueof a locally stored counter to a latest value, wherein the latest valueof the locally stored counter is useable to indicate which slot has mostrecently been written to; the client writing first data to a second slotof the second pair of slots, wherein the client writes the data to thesecond slot of the second pair of slots based on the first one or morebits indicating that the first pair of slots has been read from mostrecently by the host and the second one or more bits indicating that thefirst slot of the second pair of slots has been written to morerecently; wherein the first data includes the latest value of thelocally stored counter; the client updating the second one or more bitsin the local memory to indicate that the second slot of the second pairof slots has been written to more recently.
 2. The method of claim 1,wherein the latest value of the locally stored counter is the lastportion of the first data.
 3. The method of claim 1, wherein the secondone or more bits also indicate that a first slot of the first pair ofslots has been written to more recently.
 4. The method of claim 1,further comprising: the client reading the first one or more bits fromthe data structure on the host indicating that the first pair of slotshas been read from most recently by the host the client reading thesecond one or more bits from local memory indicating that the secondslot of the second pair of slots has been written to more recently; theclient incrementing the locally stored counter to a new latest value;the client writing second data to the first slot of the second pair ofslots, wherein the client writes the second data to the first slot ofthe second pair of slots based on the first one or more bits indicatingthat the first pair of slots has been read from most recently by thehost and the second one or more bits indicating that the second slot ofthe second pair of slots has been written to more recently; wherein thesecond data includes the new latest value of the locally stored counter;the client updating the second one or more bits in the local memory toindicate that the first slot of the second pair of slots has beenwritten to more recently.
 5. The method of claim 1, further comprisingthe client reading the first one or more bits from the data structure onthe host, wherein the first one or more bits have been updated by thehost to indicate that the second pair of slots has been read from mostrecently by the host; the client reading the second one or more bitsfrom the local memory, wherein the second one or more bits indicate thata first slot of the first pair of slots has been written to morerecently; the client incrementing the locally stored counter to a newlatest value; the client writing second data to a second slot of thefirst pair of slots, wherein the client writes the second data to thesecond slot of the first pair of slots based on the first one or morebits indicating that the second pair of slots has been read from mostrecently by the host and the second one or more bits indicating that thefirst slot of the first pair of slots has been written to more recently;wherein the second data includes the new latest value of the locallystored counter; the client updating the second one or more bits in thelocal memory to indicate that the second slot of the first pair of slotshas been written to more recently.
 6. A computer-accessible memorymedium storing program instructions executable to: read a first one ormore bits from a data structure on a host, wherein the data structurecomprises a first pair of slots, a second pair of slots and the firstone or more bits, and wherein the first one or more bits indicate thatthe first pair of slots has been read from most recently by the host;wherein the memory medium stores a second one or more bits that indicatethat a first slot of the second pair of slots has been written to morerecently; read the second one or more bits; increment a value of acounter to a latest value, wherein the value of the counter is useableto indicate which slot has been written to most recently; write firstdata to a second slot of the second pair of slots based on the first oneor more bits indicating that the first pair of slots has been read frommost recently by the host and the second one or more bits indicatingthat the first slot of the second pair of slots has been written to morerecently; wherein the first data includes the latest value of thecounter; update the second one or more bits to indicate that the secondslot of the second pair of slots has been written to more recently. 7.The memory medium of claim 6, wherein the counter is stored on thememory medium.
 8. The memory medium of claim 6, wherein the value of thecounter is the last portion of the first data.
 9. The memory medium ofclaim 6, wherein the program instructions are further executable to:read the first one or more bits from the data structure on the hostindicating that the first pair of slots has been read from most recentlyby the host; read the second one or more bits indicating that the secondslot of the second pair of slots has been written to more recently;increment the counter to a new latest value; write second data to thefirst slot of the second pair of slots based on the first one or morebits indicating that the first pair of slots has been read from mostrecently by the host and the second one or more bits indicating that thesecond slot of the second pair of slots has been written to morerecently; wherein the second data includes the new latest value of thecounter; update the second one or more bits to indicate that the firstslot of the second pair of slots has been written to more recently. 10.The memory medium of claim 6, wherein the program instructions arefurther executable to: read the first one or more bits from the datastructure on the host, wherein the first one or more bits have beenupdated by the host to indicate that the second pair of slots has beenread from most recently by the host; read the second one or more bits,wherein the second one or more bits indicate that a first slot of thefirst pair of slots has been written to more recently; increment thevalue of the counter to a new latest value; write second data to asecond slot of the first pair of slots based on the first one or morebits indicating that the second pair of slots has been read from mostrecently by the host and the second one or more bits indicating that thefirst slot of the first pair of slots has been written to more recently;wherein the second data includes the new latest value of the counter;update the second one or more bits to indicate that the second slot ofthe first pair of slots has been written to more recently.
 11. A clientdevice which transfers data to a remote host, the client devicecomprising: a memory medium; a functional unit coupled to the memorymedium, configured to: read a first one or more bits from a datastructure on the remote host, wherein the data structure comprises afirst pair of slots, a second pair of slots and the first one or morebits, and wherein the first one or more bits indicate that the firstpair of slots has been read from most recently by the host; read asecond one or more bits from the memory medium, wherein the second oneor more bits indicate that the first slot of the second pair of slotshas been written to more recently; increment a value of a counter to alatest value, wherein the counter is stored on the memory medium and thevalue of the counter is useable to indicate which slot has most recentlybeen written to; write first data to a second slot of the second pair ofslots based on the first one or more bits indicating that the first pairof slots has been read from most recently by the host and the second oneor more bits indicating that the first slot of the second pair of slotshas been written to more recently, wherein the first data includes thelatest value of the counter; update the second one or more bits on thememory medium after writing to the second slot of the second pair ofslots to indicate that the second slot of the second pair of slots hasbeen written to more recently.
 12. The client device of claim 11,wherein the value of the counter is the last portion of the first data.13. The client device of claim 11, wherein the functional unit isfurther configured to: read the first one or more bits from the datastructure on the host indicating that the first pair of slots has beenread from most recently by the host; read the second one or more bitsindicating that the second slot of the second pair of slots has beenwritten to more recently; increment the counter to a new latest value;write second data to the first slot of the second pair of slots based onthe first one or more bits indicating that the first pair of slots hasbeen read from most recently by the host and the second one or more bitsindicating that the second slot of the second pair of slots has beenwritten to more recently, wherein the second data includes the newlatest value of the counter; update the second one or more bits toindicate that the first slot of the second pair of slots has beenwritten to more recently.
 14. The client device of claim 11, wherein thefunctional unit is further configured to: read the first one or morebits from the data structure on the host, wherein the first one or morebits have been updated by the host to indicate that the second pair ofslots has been read from most recently by the host; read the second oneor more bits, wherein the second one or more bits indicate that a firstslot of the first pair of slots has been written to more recently;increment the value of the counter to a new latest value; write seconddata to a second slot of the first pair of slots based on the first oneor more bits indicating that the second pair of slots has been read frommost recently by the host and the second one or more bits indicatingthat the first slot of the first pair of slots has been written to morerecently, wherein the second data includes the new latest value of thecounter; update the second one or more bits to indicate that the secondslot of the first pair of slots has been written to more recently.
 15. Asystem, comprising A host system, comprising a first processor and afirst memory medium; A client device, comprising a functional unit, asecond memory medium, and a counter; wherein the host system and theclient device are electrically coupled to allow communication; whereinthe first memory medium comprises a data structure, wherein the datastructure comprises a first pair of slots, a second pair of slots, and afirst one or more bits, wherein the first one or more bits indicatewhich pair of slots the host system has read from most recently; whereinthe counter is useable to indicate which slot has been most recentlywritten to by the client device; wherein the second memory mediumcomprises a second one or more bits, wherein the second one or more bitsindicate which pair of slots has been written to by the client devicemost recently, and which slot of each pair of slots has been written toby the client device more recently; wherein the functional unit isconfigured to: read the first one or more bits from the first memorymedium; read the second one or more bits from the second memory medium;increment the counter to a latest value; write data to a slot in thedata structure on the first memory medium of the host system, whereinthe slot is determined based on reading from the first one or more bitsand the second one or more bits, wherein the slot comprises whicheverslot has not been written to more recently of the pair of slots whichhas not been read from most recently, and wherein the data includes thelatest value of the counter; update the second one or more bits toreflect any change in which pair of slots has been written to by theclient device most recently and which slot of each pair of slots hasbeen written to by the client device more recently after writing data tothe slot; wherein the first memory medium further comprises programinstructions executable by the first processor to: determine which pairof slots has been written to by the client device most recently based onthe counter value for each slot of the data structure; update the firstone or more bits to indicate that the host system has most recently readfrom the pair of slots most recently written to by the client device;determine which slot in the determined pair of slots has been written tomost recently based on the counter value for each slot in the determinedpair of slots; read data from the slot determined to have been writtento by the client device most recently.
 16. The system of claim 15,wherein the counter is stored on the second memory medium.
 17. Acomputer-accessible memory medium comprised on a client device, whereinthe memory medium comprises program instructions executable to transferdata to a host, wherein the host stores a data structure comprising afirst pair of slots and a second pair of slots, wherein the programinstructions are executable by the client device to: read firstinformation from the host, wherein the first information indicates astatus of read operations from the data structure by the host; readsecond information from the memory medium, wherein the secondinformation indicates a status of write operations to the data structureby the client device; determine which slot of the data structure shouldbe written to based on the first information and the second information;increment a value of a counter to a latest value, wherein the value ofthe counter is useable to indicate which slot has been written to mostrecently; write first data to the determined slot, wherein the firstdata includes the latest value of the counter; update the secondinformation to indicate that the determined slot has been written tomost recently, wherein the first information indicates from which pairof slots the host has most recently read, and wherein the secondinformation indicates which slot of each pair of slots has been writtento most recently by the client device.
 18. The computer-accessiblememory medium of claim 17, wherein said determining which slot of thedata structure should be written to comprises determining which slot hasnot been written to more recently of the pair of slots that has not beenread from most recently.
 19. The computer-accessible memory medium ofclaim 17, wherein the counter is stored on the memory medium.